class Solution {
public: // 根据决策树设计代码
    vector<vector<int>> ret;
    vector<int> path;
    vector<vector<int>> subsets(vector<int>& nums) {
        dfs(nums, 0);
        return ret;
    }
    void dfs(vector<int>& nums, int n) {
        if (n == nums.size()) {
            ret.push_back(path);
            return;
        }
        path.push_back(nums[n]);
        dfs(nums, n + 1);
        path.pop_back();
        dfs(nums, n + 1);
    }
};